<?php
require_once 'BaseController.php';

/**
 * 物件リクエスト確認画面コントローラクラス<br />
 *
 * @package apamanshop
 * @author A.Miyata
 * @copyright　
 */
class Inquiry_RequestcnfController extends Inquiry_BaseController
{
	/**
	 * インデックスアクション
	 *
     * @access public
     * @return void
	 */
	public function indexAction()
	{
		$this->setMainTemplate('cms_search2.tpl');
        //表示テンプレートパス設定
        $this->_display_path = APPLICATION_PATH . '/modules/inquiry/views/scripts/estate.tpl';
		// パラメータの取得
		//$this->_params = $this->getParameters();

        //=====表示用共通パラメータ設定=====
		$this->_data =  $this->_params;
		$this->setCommonParams();
		$this->setSubParams();

		//DB問合せ：ご希望の検索条件一覧取得
	    $loader = new Zend_Application_Module_Autoloader(array(
			'namespace' => 'Rstobi',
			'basePath' => APPLICATION_PATH . '/modules/rstobi',
		));
		$this->_model = new Rstobi_Model_SearchDisplay();

	    $loader = new Zend_Application_Module_Autoloader(array(
			'namespace' => 'Search',
			'basePath' => APPLICATION_PATH . '/modules/search',
		));
		$this->_model_inquiry = new Search_Model_Requesttenpo();

		//検索条件（地域・沿線）の反映
		$this->_model->getSearchConditionChiikiEnsen($this->_params,$this->_data);

		//検索条件（基本条件）の反映
		$this->_model->getSearchConditionKihon($this->_params,$this->_data);
		//検索条件（こだわり条件）の反映
		$this->_model->getSearchConditionKodawari($this->_params,$this->_data);

	    $this->_model_requesttenpo = new Search_Model_Requesttenpo();

		//DB問合せ：店舗リスト取得
        $this->_shopList = $this->_model_inquiry->getTenpoEkiNameList($this->_params['SelectedShop']);
        $paramarray = array();

        $this->_data['shopList']  = $this->_shopList;

        // hiddenタグ生成
        $this->_data['hiddenTag'] = Apm_Util::generateHiddenTag($this->_params);

        //===キャンペーン情報取得===
        $this->setCampaignParams("2, 4", 1);

		//=====ブロック設定=====
		$this->setBlockRequestScript();
		$this->setSubblockHpCommon();
		$this->setBlock($this->_requestcnf_easy_helper);

		//=====表示=====
        $this->display($this->_display_path);
	}

	/**
	 * 物件リクエスト画面共通パラメータ設定
	 *
	 */
	private function setSubParams()
	{
		//=====タイトル=====
		$this->setTitle('賃貸情報アパマンショップ[おまかせ物件リクエスト]');

		//=====フッタのトップへ戻るコメント=====
		$this->_data['footerTitle'] = 'おまかせ物件リクエストページ';

		//=====タイトルバー設定=====
		$this->_data['contentsTitle'] = 'おまかせ物件リクエスト　≫　入力内容ご確認';

		// ======手順画像========
		if ($this->_params['EasyRequest'] === '1') {
			$this->_data['step_image'] = '';
		} else {
			if ($this->_params['SrhType']== Apm_Config_Search::SRHTYPE_JYUSYO){
				$this->_data['step_image'] = '/images/step_b03_04.gif';
			}else if($this->_params['SrhType'] == Apm_Config_Search::SRHTYPE_ENSENEKI){
				$this->_data['step_image'] = '/images/step_b02_05.gif';
			}
		}

		$this->addMetaCss('/css/valuable.css',array('type' => 'text/css','media' => 'all'));
		$this->addMetaCss('/css/easyrequest01.css',array('type' => 'text/css','media' => 'all'));
		
		$this->_breadcrumb->add('入力内容ご確認', $this->_sslurl . 'inquiry/requestentry');
        $this->setBreadCrumb($this->_breadcrumb->generateBreadcrumb());

	}

}
?>
